package com.zuokun.mapper;

import com.zuokun.protol.login.MsgGetAchieve;
import com.zuokun.protol.login.MsgLogin;
import com.zuokun.protol.login.MsgRegister;
import com.zuokun.vo.PlayerInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface LoginMapper {

    /**
     * 根据用户名查询账户信息
     *
     * @param username
     * @return
     */
    @Select("select * from account where username = #{username}")
    MsgLogin getUserById(String username);

    /**
     * 根据玩家id查询玩家信息
     *
     * @param id
     * @return
     */
    @Select("select * from player_info where account_id = #{id}")
    PlayerInfo getPlayerInfoById(Integer id);

    /**
     * 新增账户
     *
     * @param msgRegister
     */
    void addAccount(MsgRegister msgRegister);

    /**
     * 新增玩家信息
     *
     * @param playerInfo
     */
    void addPlayerInfo(PlayerInfo playerInfo);
}
